package monitor.view.bean;

import java.io.Serializable;

import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;

/**
 * This class is root for JSF ManagedBeans.
 * In GAE if you want to use scope different from Request, ManagedBean must implement Serializable.
 * Using inheritance all ManagedBeans, which inherit this class are also Serializable.
 */
public abstract class Base implements Serializable {

	private static final long serialVersionUID = 8952754090627598433L;

	protected HttpServletRequest getRequest() {
		HttpServletRequest req = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
		return req;
	}
}
